#include <STC89C5xRC.H>
#include "Delay.h"
sbit K1 = P3^1;
sbit K2 = P3^0;
sbit K3 = P3^2;
sbit K4 = P3^3;


unsigned char Key()
{
	unsigned char Number = 0;
	if(K1 == 0){Delay(20);while(K1==0);Delay(20);Number = 1;}
	if(K2 == 0){Delay(20);while(K2==0);Delay(20);Number = 2;}
	if(K3 == 0){Delay(20);while(K3==0);Delay(20);Number = 3;}
	if(K4 == 0){Delay(20);while(K4==0);Delay(20);Number = 4;}
	
	return Number;
	
}